package com.gusto.engine.colfil;

import java.util.Date;

/**
 * <p>A {@link Rating} is a real {@link Evaluation} 
 * described by an additional attribute which is the timestamp 
 * when the resource has been rated.</p>
 * 
 * @author amokrane.belloui@gmail.com
 *
 */
public class Rating extends Evaluation {
	
	private Date timeStamp;
	
	public Rating() {
		super();
	}
	
	public Rating(Double value) {
		super(value);
		this.timeStamp = new Date();
	}
	
	public Rating(long userId, long itemId, Double value) {
		super(userId, itemId, value);
	}

	public Rating(Date timeStamp, Double value) {
		super(value);
		this.timeStamp = timeStamp;
	}
	
	public String toString() {
		return "Rating " + this.getUserId() + "-" + this.getItemId() + " : " + this.getValue() + " (" + timeStamp + ")";
	}
	
	public Date getTimeStamp() {
		return timeStamp;
	}

	public void setTimeStamp(Date timeStamp) {
		this.timeStamp = timeStamp;
	}
	
}
